{extend name="Layout/edit" /}
{block name="content"}
<!-- form start -->
<form action="{:U('editSave')}" method="post" class="form-horizontal">
    <div class="box-body" style="height:360px;">
        <div class="form-group">
            <label class="col-sm-2 control-label">类别</label>
            <div class="col-sm-10">
                <select name="category_name" class="form-control input-sm" data-url="{:U('getCategoryTreeJson')}" data-value="{$data.category_name}"></select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">内容</label>
            <div class="col-sm-10">
                <input type="text" name="content" class="form-control input-sm" placeholder="内容" value="{$data.content}" required="required" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">解禁时间</label>
            <div class="col-sm-5">
                <div class="input-group date xsui-datetimepicker" data-link-field="release_time" data-xsui-option="{pickerPosition: 'bottom-left'}">
                    <input type="text" name="release_time" class="form-control input-sm" value="{$data.release_time|default=date('Y-m-d H:i:s')}" placeholder="解禁时间" />
                    <span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
                    <span class="input-group-addon"><span class="glyphicon glyphicon-time"></span></span>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">状态</label>
            <div class="col-sm-10">
                {xshtml:radio name="status" data='array("1"=>"启用","0"=>"停用")' value="data['status']|default='1'" /}
            </div>
        </div>
    </div>
    <!-- /.box-body -->
    <div class="box-footer">
        <button type="button" class="btn btn-default xsui-btn-close-dialog">取消</button>
        <button type="submit" class="btn btn-primary pull-right">保存</button>
        <input type="hidden" name="id" value="{$data.id}"/>
    </div>
    <!-- /.box-footer -->
</form>
{/block}
{block name="script_after"}
<script>
    $('select[name="category_name"]').ajaxcombobox({first:{id:"",text:"选择类别"}});
</script>
{/block}